//
//  SXVideoMainListCollectionViewCell.m
//  ShiXun
//
//  Created by lanou on 15/10/26.
//  Copyright © 2015年 张琪. All rights reserved.
//

#import "SXVideoMainListCollectionViewCell.h"
#import "UIView+UIView.h"
#import "UIImageView+WebCache.h"

@implementation SXVideoMainListCollectionViewCell

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        _iconImageView = [[UIImageView alloc] initWithFrame:CGRectMake(5, 5, self.width - 10, self.height - 10)];
        _iconImageView.layer.cornerRadius = 15;
        _iconImageView.layer.masksToBounds = YES;
        [self.contentView addSubview:_iconImageView];
        
        _nameLabel = [[UILabel alloc] initWithFrame:CGRectMake(self.width / 2 - 20, self.height / 2 - 10, 40, 20)];
        _nameLabel.textAlignment = NSTextAlignmentCenter;
        _nameLabel.backgroundColor = [UIColor colorWithWhite:0.848 alpha:0.100];
        _nameLabel.font = [UIFont systemFontOfSize:15];
        [_iconImageView addSubview:_nameLabel];
    }
    return self;
}

- (void)setConfigureModel:(SXVideoMainListModel *)configureModel
{
    _configureModel = configureModel;
    
    _nameLabel.text = configureModel.name;
    _iconImageView.image = [UIImage imageNamed:configureModel.name];
}

@end
